[IA64] fix vcpu_itr_i(), vcpu_itr_d() and vcpu_flush_tlb_vhpt_range() callers
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Mon, 10 Jul 2006 20:11:44 +0000 (14:11 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Mon, 10 Jul 2006 20:11:44 +0000 (14:11 -0600)
- vcpu_itr_i() and vcpu_itr_d() must purge vTLB entry which overlaps the
  new inserted entry.
- some address argument of vcpu_flush_tlb_vhpt_range() was wrong.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/arch/ia64/xen/faults.c
xen/arch/ia64/xen/vcpu.c

index 0c2d0479154090fe2f024a8460297145a752cb1f..b30470e6ab3a320546a945b280da456b1bfb3784 100644 (file)
@@ -208,8 +208,7 @@ void ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_reg
                    p2m_entry_retry(&entry)) {
                        /* dtlb has been purged in-between.  This dtlb was
                           matching.  Undo the work.  */
-                       vcpu_flush_tlb_vhpt_range(address & ((1 << logps) - 1),
-                                                 logps);
+                       vcpu_flush_tlb_vhpt_range(address, logps);
 
                        // the stale entry which we inserted above
                        // may remains in tlb cache.
index d820c7faf6618ab117a08688c6ddb75e193784fa..e9dda6341f7baf94cc26a13ab24649b8a2bf5d7d 100644 (file)
@@ -1906,10 +1906,16 @@ IA64FAULT vcpu_itr_d(VCPU *vcpu, UINT64 slot, UINT64 pte,
        TR_ENTRY *trp;
 
        if (slot >= NDTRS) return IA64_RSVDREG_FAULT;
+
+       vcpu_purge_tr_entry(&PSCBX(vcpu, dtlb));
+
        trp = &PSCBX(vcpu,dtrs[slot]);
 //printf("***** itr.d: setting slot %d: ifa=%p\n",slot,ifa);
        vcpu_set_tr_entry(trp,pte,itir,ifa);
        vcpu_quick_region_set(PSCBX(vcpu,dtr_regions),ifa);
+
+       vcpu_flush_tlb_vhpt_range(ifa & itir_mask(itir), itir_ps(itir));
+
        return IA64_NO_FAULT;
 }
 
@@ -1919,10 +1925,16 @@ IA64FAULT vcpu_itr_i(VCPU *vcpu, UINT64 slot, UINT64 pte,
        TR_ENTRY *trp;
 
        if (slot >= NITRS) return IA64_RSVDREG_FAULT;
+
+       vcpu_purge_tr_entry(&PSCBX(vcpu, itlb));
+
        trp = &PSCBX(vcpu,itrs[slot]);
 //printf("***** itr.i: setting slot %d: ifa=%p\n",slot,ifa);
        vcpu_set_tr_entry(trp,pte,itir,ifa);
        vcpu_quick_region_set(PSCBX(vcpu,itr_regions),ifa);
+
+       vcpu_flush_tlb_vhpt_range(ifa & itir_mask(itir), itir_ps(itir));
+
        return IA64_NO_FAULT;
 }
 
@@ -1990,7 +2002,7 @@ again:
        vcpu_itc_no_srlz(vcpu,2,ifa,pteval,pte,logps);
        if (swap_rr0) set_metaphysical_rr0();
        if (p2m_entry_retry(&entry)) {
-               vcpu_flush_tlb_vhpt_range(ifa & ((1 << logps) - 1), logps);
+               vcpu_flush_tlb_vhpt_range(ifa, logps);
                goto again;
        }
        return IA64_NO_FAULT;
@@ -2013,7 +2025,7 @@ again:
        vcpu_itc_no_srlz(vcpu, 1,ifa,pteval,pte,logps);
        if (swap_rr0) set_metaphysical_rr0();
        if (p2m_entry_retry(&entry)) {
-               vcpu_flush_tlb_vhpt_range(ifa & ((1 << logps) - 1), logps);
+               vcpu_flush_tlb_vhpt_range(ifa, logps);
                goto again;
        }
        return IA64_NO_FAULT;